<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>Title</title>
</head>
<body>

<c:choose>
    <%--如果购物车为空--%>
   <c:when test="${empty cart}">
       购物车为空
       <a href="shopingcenter.jsp">商城</a>
   </c:when>
    <c:otherwise>
        <c:if test="${flag}">
            您的余额不足，请及时充值<br>
        </c:if>
        您购买的蛋糕有:<br>
        <c:forEach items="${cart}" var="cake">
            ${cake.name}${cake.price}元
            <a href="${pageContext.request.contextPath}/jian?id=${cake.id}">-</a>
            <a href="${pageContext.request.contextPath}/jia?id=${cake.id}">+</a>
            <br>


        </c:forEach>
        总价格为:${totalprice}<br>
        <a href="${pageContext.request.contextPath}/jiezhang">结账</a>
        <a href="shopingcenter.jsp">返回商城</a>
    </c:otherwise>
</c:choose>



</body>
</html>
